//
// Created by liangwenhao on 2024/4/4.
//

#include "motor_task.h"


/// 传送带电机
void LoadMotor_Task(void *argument)
{
    for(;;)
    {
        osDelay(1);
        LoadMotor_real_angle_set(Load_CrossAngle);
    }
}

/// Yaw轴电机-镖架制导
void YawMotor_Task(void *argument)
{
    for(;;)
    {
        osDelay(1);
        YawMotor_angle_set(YawMotor_Target_Angle);
    }
}

/// 弹射能量控制
void LocateMotor_Task(void *argument)
{
    for(;;)
    {
        osDelay(1);
        Motor_real_angle_set(&LocateMotor,Locate_CrossAngle,&can2Tx_0x200);
    }
}

/// 电机标志位切换，我也不知道有什么用
void Motor_Flag_change_Task(void *argument)
{
    for(;;)
    {
        osDelay(10);
        Motor_Flag_change(&LoadMotor1);
        Motor_Flag_change(&LoadMotor2);

    }
}

/**
 * @brief 电机运动过程中可能会抖动，不会影响发射但是看着难受，所以要进行检测与消抖处理
 * @param argument
 */
void Motor_Shake_Judge_Task(void *argument)
{
    for(;;)
    {
        osDelay(2);
        LoadMotor_ShakeJudge();
        //LocateMotor_ShakeJudge();
        //YawMotor_ShakeJudge();
    }
}
